<template>
  <div class="headerwrapper">
    <van-nav-bar
      :title="title"
      :left-text="leftText"
      :right-text="rightText"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
  </div>
</template>
<script>
  export default {
    props: {
        title:{
            type: String,
            default: '标题'
        },
        leftText: {
            type: String,
            default: '返回'
        },
        rightText: {
            type: String,
            default: '按钮'
        }
    },
    methods: {
      onClickLeft() {
        var _this = this;
        _this.$route.matched[0].instances.default.onClickLeft();
      },
      onClickRight() {
        var _this = this;
        _this.$route.matched[0].instances.default.onClickRight();
      }
    }
  };
</script>
<style lang="less" scoped>
  .headerwrapper1 {
    height: 50px;
    width: 100%;
    display: flex;
    flex-flow: row;
    justify-content: space-between;
  }
</style>
